<extend name="public@base5"/>
<block name="head">
    <style>
        table label{color:#AAA}
    </style>
</block>
<block name="main">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link active" href="{:url('orderList')}">订单管理</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('orderList2')}">藏品订单</a>
            </li>
            
        </ul>
        <div class="card margin-top-20">
            <div class="card-body">
                <form class=" bg-white row row-cols-lg-auto gap-1 g-3 align-items-center" method="get"
                      action="{:url('orderList')}">
                    <div class="col-12">
                        <input type="text" class="form-control" name="user_login"
                               value="{:input('request.user_login','')}" placeholder="用户ID/昵称/手机">
                    </div>
                    <div class="col-12">
                        <input type="text" class="form-control" name="order_id"
                               value="{:input('request.order_id','')}" placeholder="订单号/商品名称">
                    </div>
                    <div class="col-12">
                        <select name="status" class="form-control" id="status">
                            <option value="-2">订单状态</option>
                            <option value="-1">全部</option>
                            <option value="0">交易失败</option>
                            <option value="1">交易成功</option>
                            <option value="2">已发货</option>

                        </select>
                    </div>
                    <div class="col-6">
                        <input type="date" name="date_start"
                               value="{:input('request.date_start/s','')}" >
                    -
                        <input type="date"  name="date_end"
                               value="{:input('request.date_end/s','')}" >
                    </div>
                    <div class="col-12">
                        <input type="submit" class="btn btn-primary" value="{:lang('Search')}"/>
                        <a class="btn btn-danger" href="{:url('orderList')}">{:lang('Clear')}</a>
                        <input type="submit" class="btn btn-info" name="export" value="导出"/>
                    </div>
                </form>
            </div>
        </div>
       
        <table class="table table-hover table-bordered margin-top-20">
            <thead>
            <tr>
                <th width="50">编号</th>
                <th>商品名称</th>
                <th>价格x数量=总价</th>
                <th>ID/手机</th>
                <th>头像</th>
                <th>昵称</th>
                <th>收货地址</th>
                <th>图标</th>
                <th width="160">购买时间</th>

                <th width="90">{:lang('STATUS')}</th>
                <th width="80">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            
            <foreach name="items" item="vo">
                <tr class="c_{$vo.status}">
                    <td><label>订单编号</label>：{$vo.id}<br/><label>商品编号</label>: {$vo.item_id}</td>
                    <td>
                        {$vo.item_name}
                    </td>
                                       
                    <td>{$vo.item_price}<label>x</label>{$vo.item_num}<label>=</label>{$vo.cost}</td>
                    <td>
                        {$vo.user_id}<br/>
                        <label>手机号</label>:<br/>
                        {$vo.mobile}
                    </td>
                     <td>
                         <img width="45" height="45" src="{:url('user/Public/avatar',array('id'=>$vo['uid']))}"/>
                     </td>
                     <td>
                        {$vo.user_nickname}
                    </td>
                    <td><label>收货地址</label><br/>
                        {$vo.address}<br/>
                    <label>物流编号</label><br/>
                        {$vo.logistics}
                <if condition="$vo.status eq 2">
                    <a href="{:url('edit_logistics')}?order_id={$vo.id}" data-refresh="true" class="js-dialog btn btn-sm btn-outline-info" title="设置物流单号" >编辑</a>
                </if>
                    </td>
                    <td>
                        <img src="{:cmf_get_image_preview_url($vo['item_url'])}" width="100px" height="80px">
                     </td>
                     <td>
                         <label>下单时间</label>:<br/>{:date('Y-m-d H:i:s',$vo['create_time'])}<br/><notEmpty name="$vo['pay_time']"><label>支付时间</label>:<br/>{$vo['pay_time']}</notEmpty>
                    </td>
                    <td>
                        {$vo.desc}
                    <if condition="$vo.booth_type gt 1">
                        <if condition="$vo.status eq 1">
                            <br/>
                            <a class="btn btn-warning js-ajax-delete" data-msg="是否发货" href="admin/store/fahuo/id/{$vo.id}">发货</a>
                            <elseif condition="$vo.status eq 2"/><label class="text-bg-success">已发货</label>
                            <elseif condition="$vo.status eq 3"/><label class="text-bg-success">已收货</label>
                        </if>
                    </if>
                    </td>
                    <td>
                       
                        
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="javascript:"
                           data-href="admin/store/del_order/{$vo.id}" title="{:lang('DELETE')}" data-toggle="tooltip">
                            <i class="fa fa-trash fa-fw"></i>
                        </a>
                        
                        
                        <a class="btn btn-xs btn-info js-dialog" title="{$vo.id}订单详情" href="{:url('order_detail')}?orderid={$vo.id}">
                            <i class="fa fa-info fa-fw"></i>详情
                        </a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </div>
</block>
